package com.authsphere.security.authenticator.api;

import java.util.concurrent.TimeUnit;

/**
 * @program: AuthSphere
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/26 16:02
 **/
public interface Authenticator {

    /**
     * 匹配
     * @param rawKey rawKey
     * @param rawCode rawCode
     * @return is matches
     */
    boolean matches(String rawKey, String rawCode);

    /**
     * 设置
     * @param key key
     * @param value value
     * @param expire expire time
     * @param timeUnit time unit
     * @return is success
     */
    boolean send(String key, String value, long expire, TimeUnit timeUnit);

    /**
     * 移除
     * @param key key
     * @return is success
     */
    boolean remove(String key);
}
